using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - ApplicationRoles Builder  --**********************
//--Created By: trooks
//--Description: ApplicationRoles Builder Class
//--Created Date: 03/07/2013 10:48:44
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class ApplicationRoles_Builder : IApplicationRoles_builder 
	{
		
	public List<IApplicationRoles_biz> BuildParts (IApplicationRoles_biz _param)
	{
			IApplicationRoles_biz temp = new ApplicationRoles_biz();
			IApplicationRolesController cont = new ApplicationRolesController();
			List<IApplicationRoles_biz> tempList = new List<IApplicationRoles_biz>();
			List<IApplicationRoles> tempData = new List<IApplicationRoles>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = ApplicationRolesTranslator.TranslateFromDataLayer(cont.ApplicationRoles_GetOne(ApplicationRolesTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.ApplicationRoles_GetAll(ApplicationRolesTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationRolesTranslator.TranslateFromDataLayer(p)).Cast<IApplicationRoles_biz>().ToList();
				return tempList;

				case "Application_ApplicationRoles_ByParent":
				tempData = cont.Application_ApplicationRoles_ByParent(ApplicationRolesTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationRolesTranslator.TranslateFromDataLayer(p)).Cast<IApplicationRoles_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IApplicationRoles_biz> BuildParts (IApplicationRolesSearch_biz _param)
	{
			IApplicationRoles_biz temp = new ApplicationRoles_biz();
			IApplicationRolesController cont = new ApplicationRolesController();
			List<IApplicationRoles_biz> tempList = new List<IApplicationRoles_biz>();
			List<IApplicationRoles> tempData = new List<IApplicationRoles>();
			tempData = cont.ApplicationRoles_Search(ApplicationRolesTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => ApplicationRolesTranslator.TranslateFromDataLayer(p)).Cast<IApplicationRoles_biz>().ToList();
			return tempList;

	}
		
	}
}
